//
//  PaiHangView.m
//  TEst
//
//  Created by   丛熠超 on 2017/4/14.
//  Copyright © 2017年 Tongcheng. All rights reserved.
//

#import "PaiHangView.h"

@implementation PaiHangView

- (void)setIsThisWeek:(BOOL)isThisWeek
{
    _isThisWeek = isThisWeek;
    if (isThisWeek == YES) {
        [self.ThisWeek setBackgroundImage:[UIImage imageNamed:@"100元话费"] forState:UIControlStateNormal];
        [self.ThisWeek setTitleColor:RGB(0xF95880) forState:UIControlStateNormal];
        [self.LastWeek setBackgroundImage:[UIImage imageNamed:@"50元话费"] forState:UIControlStateNormal];
        [self.LastWeek setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    }else{
        [self.LastWeek setBackgroundImage:[UIImage imageNamed:@"100元话费"] forState:UIControlStateNormal];
        [self.LastWeek setTitleColor:RGB(0xF95880) forState:UIControlStateNormal];
        [self.ThisWeek setBackgroundImage:[UIImage imageNamed:@"50元话费"] forState:UIControlStateNormal];
        [self.ThisWeek setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = [UIColor clearColor];
    self.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
    
}

+ (instancetype)gainMineHeaderView
{
    return [[NSBundle mainBundle] loadNibNamed:@"PaiHangView" owner:self options:nil].lastObject;
}

- (IBAction)GetThisWeek:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(ThisWeek)]) {
        [_delegate ThisWeek];
    }
}

- (IBAction)GetlastWeek:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(LastWeek)]) {
        [_delegate LastWeek];
    }
}
- (IBAction)GetCanceBtn:(id)sender {
    [self removeFromSuperview];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
